#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import getopt

import imn_conf
import imn_xmpp
import imn_cli
import imn_gui


def usage():
    print '-c  Command Line interface'
    print '-d  You are using imnext on a desktop'
    

if __name__ == '__main__':
    try:
        opts, args = getopt.getopt( sys.argv[1:], "cd")
    except getopt.GetoptError:
        usage()
        sys.exit(2)

    cli_mode = False
    desk_mode = False
    for opt, arg in opts:
        if opt == '-c':
            cli_mode = True
        if opt == '-d':
            desk_mode = True

    if cli_mode:
        imn_cli.init_cli()
    else:
        gui = imn_gui.init_gui(sys.argv[0], desk_mode)
        imn_gui.run_gui(gui)

